{
  "properties" : { },
  "id" : "c36553ac61d94e758556c8cba075a916",
  "script" : null,
  "groupId" : "5b4c0f1fcedc4bfbbf84bb3791e01399",
  "name" : "已绑定告警对象",
  "createTime" : 1727070935150,
  "updateTime" : 1725272377723,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "bound",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\n    \"targetName\": \"\",\n    \"targetType\": \"\",\n    \"current\": 1,\n    \"size\": 15,\n    \"ruleId\": \"100003\"\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": {\n        \"total\": 670,\n        \"current\": 1,\n        \"size\": 30,\n        \"records\": [\n            {\n                \"id\": \"690\",\n                \"code\": \"D4081373158299718321\",\n                \"targetName\": \"SN-HZBHJ.R1\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.6.1\",\n                \"rowId\": \"1\"\n            },\n            {\n                \"id\": \"724\",\n                \"code\": \"D7074082151837503452\",\n                \"targetName\": \"SN-BJ.XingFengB.R.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.2.22\",\n                \"rowId\": \"2\"\n            },\n            {\n                \"id\": \"715\",\n                \"code\": \"D4040083765810452259\",\n                \"targetName\": \"SN-NSBHJ.R1\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.12.1\",\n                \"rowId\": \"3\"\n            },\n            {\n                \"id\": \"737\",\n                \"code\": \"D1113602235964814951\",\n                \"targetName\": \"SN-YA.NuanYangGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.10.62\",\n                \"rowId\": \"4\"\n            },\n            {\n                \"id\": \"691\",\n                \"code\": \"D6035517584307299936\",\n                \"targetName\": \"SN-YL.LuQuB.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.5.51\",\n                \"rowId\": \"5\"\n            },\n            {\n                \"id\": \"739\",\n                \"code\": \"D7175563092666679777\",\n                \"targetName\": \"SN2-XY.R1\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"2.61.14.1\",\n                \"rowId\": \"6\"\n            },\n            {\n                \"id\": \"728\",\n                \"code\": \"D4709667069592879480\",\n                \"targetName\": \"SN-YL.XingShuWanFD.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.10.13\",\n                \"rowId\": \"7\"\n            },\n            {\n                \"id\": \"689\",\n                \"code\": \"D8601432195955858163\",\n                \"targetName\": \"\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.4.68\",\n                \"rowId\": \"8\"\n            },\n            {\n                \"id\": \"738\",\n                \"code\": \"D1328237341599725080\",\n                \"targetName\": \"SN-YL.DuJiaGouFD.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.10.3\",\n                \"rowId\": \"9\"\n            },\n            {\n                \"id\": \"757\",\n                \"code\": \"D7455570549481032063\",\n                \"targetName\": \"SN-WN.XieLiGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.3.69\",\n                \"rowId\": \"10\"\n            },\n            {\n                \"id\": \"821\",\n                \"code\": \"D1304253346743786632\",\n                \"targetName\": \"SN-YL.ZhiXinDaGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.28\",\n                \"rowId\": \"11\"\n            },\n            {\n                \"id\": \"805\",\n                \"code\": \"D2803252958945355576\",\n                \"targetName\": \"SN-YL.XuanHeGF.R(YIJIEDIAN)\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.15.57\",\n                \"rowId\": \"12\"\n            },\n            {\n                \"id\": \"793\",\n                \"code\": \"D1293543178517418683\",\n                \"targetName\": \"SN1-SL.R1\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"4.61.20.1\",\n                \"rowId\": \"13\"\n            },\n            {\n                \"id\": \"798\",\n                \"code\": \"D6412404910664497238\",\n                \"targetName\": \"SN-TC.XiLiuB.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.3.30\",\n                \"rowId\": \"14\"\n            },\n            {\n                \"id\": \"799\",\n                \"code\": \"D6193588338792803715\",\n                \"targetName\": \"SN-YL.SengTeGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.69\",\n                \"rowId\": \"15\"\n            },\n            {\n                \"id\": \"760\",\n                \"code\": \"D8189512785661630191\",\n                \"targetName\": \"XinYiB-WN-R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"10.61.135.6\",\n                \"rowId\": \"16\"\n            },\n            {\n                \"id\": \"814\",\n                \"code\": \"D1892973827867023621\",\n                \"targetName\": \"SNYL-RenQuanGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.45\",\n                \"rowId\": \"17\"\n            },\n            {\n                \"id\": \"888\",\n                \"code\": \"D1975176896306252872\",\n                \"targetName\": \"SN_YL.HaiShengGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.17\",\n                \"rowId\": \"18\"\n            },\n            {\n                \"id\": \"867\",\n                \"code\": \"D8076277083834184623\",\n                \"targetName\": \"SN-YL.HuangHeGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.10.53\",\n                \"rowId\": \"19\"\n            },\n            {\n                \"id\": \"843\",\n                \"code\": \"D3940193119644261092\",\n                \"targetName\": \"\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.71\",\n                \"rowId\": \"20\"\n            },\n            {\n                \"id\": \"903\",\n                \"code\": \"D3886945774552368661\",\n                \"targetName\": \"SN-XY-SR6608\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"10.61.250.9\",\n                \"rowId\": \"21\"\n            },\n            {\n                \"id\": \"904\",\n                \"code\": \"D1125872104570212379\",\n                \"targetName\": \"SN-WN.FuMengGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.3.92\",\n                \"rowId\": \"22\"\n            },\n            {\n                \"id\": \"862\",\n                \"code\": \"D8946916212431907934\",\n                \"targetName\": \"SN-WN.TongGuanB.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.3.94\",\n                \"rowId\": \"23\"\n            },\n            {\n                \"id\": \"830\",\n                \"code\": \"D5590651344827999698\",\n                \"targetName\": \"SN-YA.HouDeFD.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.4.59\",\n                \"rowId\": \"24\"\n            },\n            {\n                \"id\": \"864\",\n                \"code\": \"D8003650585264871714\",\n                \"targetName\": \"SN-WN.HeXuGF.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.3.75\",\n                \"rowId\": \"25\"\n            },\n            {\n                \"id\": \"897\",\n                \"code\": \"D6104573204425042310\",\n                \"targetName\": \"\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.4.80\",\n                \"rowId\": \"26\"\n            },\n            {\n                \"id\": \"919\",\n                \"code\": \"D6793426342792859843\",\n                \"targetName\": \"DaiWangB_XA_R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"10.61.110.8\",\n                \"rowId\": \"27\"\n            },\n            {\n                \"id\": \"945\",\n                \"code\": \"D5136474950277919695\",\n                \"targetName\": \"SN-YL.JinXiFD.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.10.34\",\n                \"rowId\": \"28\"\n            },\n            {\n                \"id\": \"979\",\n                \"code\": \"D6370010176822283749\",\n                \"targetName\": \"SN-YL.HuangDaLiangQYB.R\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.9.66\",\n                \"rowId\": \"29\"\n            },\n            {\n                \"id\": \"921\",\n                \"code\": \"D3264683889626475250\",\n                \"targetName\": \"\",\n                \"targetType\": \"1\",\n                \"targetDescr\": \"\",\n                \"enable\": \"1\",\n                \"ip\": \"61.2.15.34\",\n                \"rowId\": \"30\"\n            }\n        ]\n    }\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
sql = """
    select * from alarm_target where id in
    <foreach collection="arrayList" open="(" separator="," close=")" item="item">
        #{item}
    </foreach>
    <if test="body.targetName != null and body.targetName != '' ">
        and target_name like concat('%',#{body.targetName},'%')
    </if>
    <if test="body.targetType != null and body.targetType != '' ">
        and target_type = #{body.targetType}
    </if>
"""
    list = db.select(""" select * from alarm_rule_target where rule_id = #{body.ruleId} """)
    arrayList = new ArrayList()
    if (list.size() > 0) {
        for (item in list) {
            arrayList.add(item.targetId);
        }
        aaa = arrayList.size()
        print(aaa)
        return db.page(sql)
    }
    aaa = arrayList
    return null